import { createStore } from 'vuex'

const modulesA = {
  namespaced: true,
  state: {
    userName: '222'
  },
  getters: {
    newName (state) {
      return state.userName + '1111'
    }
  },
  mutations: {
    SET_USERNAME (state, value) {
      state.userName = value
    }
  },
  actions: {
    setUser (cxt) {
      cxt.commit('SET_USERNAME', 'ls')
    }
  }
}

export default createStore({
  // state: {
  // },
  // getters: {
  // },
  // mutations: {
  // },
  // actions: {
  // },
  modules: {
    modulesA
  }
})
